package cn.vcjf.weapp.api.active.mapper;

import cn.vcjf.weapp.api.active.entity.GoodsActiveRecord;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhengzihang
 * @since 2018-09-26
 */
public interface GoodsActiveRecordMapper extends BaseMapper<GoodsActiveRecord> {

	@Override
	GoodsActiveRecord selectById(Serializable id);

	GoodsActiveRecord selectCollageForUpdateById(Integer id);

	/**
	 * 取消拼团
	 * @param goodsActiveRecord
	 * @return
	 */
	int cancelGoodsCollage(GoodsActiveRecord goodsActiveRecord);

	/**
	 * 更新新团长
	 * @param goodsActiveRecord
	 * @return
	 */
	int updateNewColonel(GoodsActiveRecord goodsActiveRecord);

	/**
	 * 取消砍价
	 * @param goodsActiveRecord
	 * @return
	 */
	int cancelCutGoodsPrice(GoodsActiveRecord goodsActiveRecord);


	List<GoodsActiveRecord> selectActivePage(Page<GoodsActiveRecord> page, @Param("goodsActiveRecord") GoodsActiveRecord goodsActiveRecord);

	/**
	 * 修改过期的活动参与记录()
	 * @param expireTime 开始多少分钟后关闭
	 * @return
	 */
	int updateExpireActiveRecord(@Param("activetype") Integer activetype,@Param("expireTime")Integer expireTime);
}
